package model.vk

import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder}

case class UserInfo(
    id: Long,
    is_closed: Boolean,
    first_name: String,
    last_name: String,
    can_access_closed: Boolean
)

object UserInfo {
  case class UserInfoWrapper(response: List[UserInfo])

  given JsonDecoder[UserInfo] = DeriveJsonDecoder.gen[UserInfo]
  given JsonEncoder[UserInfo] = DeriveJsonEncoder.gen[UserInfo]

  given JsonDecoder[UserInfoWrapper] = DeriveJsonDecoder.gen[UserInfoWrapper]
  given JsonEncoder[UserInfoWrapper] = DeriveJsonEncoder.gen[UserInfoWrapper]
}
